package com.ctshk.rpc.hotel.entity.es;

import com.ctshk.common.constant.ElasticSearchConstant;
import com.ctshk.rpc.hotel.dto.h5.HotelProductDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * @description 酒店房型
 * @author 谢诗宏
 * @date 2021/4/20
 */
@Data
@ApiModel(description="酒店房型")
@Document(indexName = ElasticSearchConstant.HOTEL_ROOM_DETAIL_INDEX)
public class HotelRoomProductEs {

    @ApiModelProperty(value = "房型id")
    private Long id;

    @ApiModelProperty(value = "酒店id")
    private Long hotelId;

    @ApiModelProperty(value = "房型名称")
    private String name;

    @ApiModelProperty(value = "房型英文名称")
    private String enName;

    @ApiModelProperty(value = "最多可住人数(此字段前端需要展示对应icon)-该字段也需作为标签显示在填写订单页", example = "2人")
    private String maxAdult;

    @ApiModelProperty(value = "房间面积(此字段前端需要展示对应icon)", example = "20㎡")
    private String areaMeasure;

    @ApiModelProperty(value = "床型(此字段前端需要展示对应icon)-该字段也需作为标签显示在填写订单页", example = "120*200cm大床")
    private String bedType;

    @ApiModelProperty(value = "房型楼层(此字段前端需要展示对应icon)", example = "5-7层")
    private String roomFloors;

    @ApiModelProperty(value = "是否允许吸烟(此字段前端需要展示对应icon)", example = "允许")
    private String allowSmoke;

    @ApiModelProperty(value = "是否可加床(此字段前端需要展示对应icon)", example = "可加2张床")
    private String canAddBed;

    @ApiModelProperty(value = "是否有窗户(此字段前端需要展示对应icon)", example = "有窗")
    private String hasWindow;

    @ApiModelProperty(value = "是否免费网络(此字段前端需要展示对应icon)", example = "收费")
    private String isFreeNet;

    @ApiModelProperty(value = "网络类型(此字段前端需要展示对应icon)", example = "WiFi")
    private String netType;

    @ApiModelProperty(value = "是否含早-该字段也需作为标签显示在填写订单页", example = "含早餐")
    private String hasBreakfast;

    @ApiModelProperty(value = "费用说明", example = "網絡24小時 50元")
    private String costDescription;

    @ApiModelProperty(value = "房型设施(此房型的设施字段是纯字符串,不用做任何处理)", example = "雨伞、书桌、熨衣设备")
    private String roomFacilities;

    @ApiModelProperty(value = "封面图地址", example = "https://ctshk-cloud-dev.oss-cn-hongkong.aliyuncs.com/resource/web/Resource/Hotel/resources/Add/1617352101540.jpg")
    private String coverImg;

    @ApiModelProperty(value = "图片JSON(前端轮播图主取这个字段)", example = "\"[{\"url\":\"https://ctshk-cloud-dev.oss-cn-hongkong.aliyuncs.com/resource/web/Resource/Hotel/resources/Add/1618284128786.jpg\",\"name\":\"下载.jpg\"}]\"")
    private String photoJson;

    @ApiModelProperty(value = "产品列表数据")
    private List<HotelProductDTO> hotelProducts;

    @Field(type = FieldType.Date,
            format = DateFormat.custom,
            pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING,
            pattern = "yyyy-MM-dd",
            timezone = "GMT+8")
    @ApiModelProperty(value = "入住日期", example = "2021-05-01")
    private LocalDate checkInDate;

    @Field(type = FieldType.Date,
            format = DateFormat.custom,
            pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING,
            pattern = "yyyy-MM-dd",
            timezone = "GMT+8")
    @ApiModelProperty(value = "离店日期", example = "2021-05-03")
    private LocalDate checkOutDate;

    @ApiModelProperty(value = "成人数", example = "2")
    private Integer adultNum;

    @ApiModelProperty(value = "小童数-没有传0", example = "4", required = true)
    private Integer childrenNum;

}
